#pragma once

#include <QMainWindow>
#include <qchart.h>
QT_CHARTS_USE_NAMESPACE
#include "ui_multi_detect_page.h"
#include <qmouseeventtransition.h>
#include <qstring.h>
#include <qpushbutton.h>
#include <qbarseries.h>
#include <qchartview.h>
#include <qwidget.h>
#include <qvector.h>
#include <qlist.h>
#include <qbarcategoryaxis.h>

#include <qnetworkreply.h>
#include <qnetworkrequest.h>

#include "http_client.h"

class multi_detect_page : public QMainWindow
{
	Q_OBJECT

public:
	multi_detect_page(QWidget *parent = nullptr);
	~multi_detect_page();

	bool eventFilter(QObject* obj, QEvent* event);

private:
	Ui::multi_detect_pageClass ui;
	QString upload_dir;
	QPushButton* export_button = nullptr;

	//QList<QBarSet*>sets;
	
	//QBarSeries* series = nullptr;
	//QChart* chart = nullptr;

	//QBarCategoryAxis* axis = nullptr;
	//QVector<QBarSet*> sets;
	QString json_reply_data;
	QChartView* chart_view = nullptr;

	QNetworkReply* reply = nullptr;

	/*QMap<QString, QVector<QVector<int>>>& name2annot;
	QStringList categories_list;*/

	void update_chart(QString set_name, QString json_raw_str);

private slots:
	void upload_detect_slot();
	void upload_replyFinished();
	void export_data_table_slot();

	
};
